﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Products;

public partial class search_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Request.QueryString["query"] != null)
            {
                Showproduct(Request.QueryString["query"].ToString());
            }
        }
    }
    protected void Showproduct(string query)
    {
        DataTable tbl = Product.GetProductByName(query);
        this.litsproduct.DataSource = tbl;
        LTongcong.Text = "Có " + tbl.Rows.Count.ToString() + "sản phẩm đuợc tìm thấy.";
        this.litsproduct.DataBind();
    }
    protected void litsproduct_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
}
